package jdbc.chapter_Jan_1_2019;

import java.sql.*;
import java.util.HashSet;


public class test {
    public static void main(String[] args) throws  SQLException {
    String sql="select *from JOBS where job_title like ?";
     ResultSet rs = DjdbcU.selectSql(sql,"Programmer");
     while (rs.next()){
         System.out.println(rs.getString(1));
     }

     String sql2="Insert into regions(region_id,region_name) values (?,?)";
        System.out.println(DjdbcU.uptata(sql2,70,"西班牙"));

      /*  ResultSet rs=DjdbcU.selectSql(sql);
        while (rs.next()){
            System.out.println(rs.getString(1));
        }*/
        /* Class.forName("oracle.jdbc.driver.OracleDriver");
     String url="jdbc:oracle:thin:@localhost:1521:xe";
     String usrt="hr";
     String possword="123";
     Connection connection= DriverManager.getConnection(url,usrt,possword);
        System.out.println("连接成功 ");
       String sql="Insert into regions(region_id,region_name) values (?,?)";
       String sql2="delete from regions where region_name='上海'";
        PreparedStatement preparedStatement=connection.prepareStatement(sql2);*/
       /* String regin_name="上海";
        Integer regin_id=8;
        preparedStatement.setInt(1,regin_id);
        preparedStatement.setString(2,regin_name);*/
//        preparedStatement.executeUpdate();
//        List<String> ls=new ArrayList<>();
//        ls.clear();
//        preparedStatement.close();


    }
}
